package com.ruoyi.web.controller.shopping.area;

import com.ruoyi.system.domain.Area;
import com.ruoyi.system.service.AreaService;
import com.ruoyi.system.view.common.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/xiaomi/v2/area")
public class AreaController {
    @Autowired
    private AreaService areaService;

    @GetMapping("/{pid}")
    public R<List<Area>> getArea(@PathVariable(value = "pid") Integer pid){
        List<Area> area = areaService.getArea(pid);
        return R.success(area);
    }
}
